<admintpl file="header" />
</head>
<body>
	<div class="wrap js-check-wrap">
		<ul class="nav nav-tabs">
			<li class="active"><a href="{:U('Enve/index')}">红包列表</a></li>
		</ul>
        <form class="well form-search" method="post" action="{:U('Enve/index')}">
            请输入OpenId:
            <input type="text" name="openid" style="width: 100px;" value="{:I('request.openid/s','')}" placeholder="请输入OpenId">
			关键字:
            <input type="text" name="keywork" style="width: 200px;" value="{:I('request.keywork/s','')}" placeholder="用户名/口令/">
            <input type="submit" class="btn btn-primary" value="搜索" />
            <a class="btn btn-danger" href="{:U('Enve/index')}">清空</a>
        </form>
		<table class="table table-hover table-bordered">
			<thead>
				<tr>
					<th>ID</th>
					<th>用户名称</th>
					<th>口令</th>
					<th>金额</th>
					<th>支付类型</th>
					<th>支付状态</th>
					<th>openid</th>
					<th>发红包时间</th>
					<th>操作</th>
				</tr>
			</thead>
			<tbody>
				<foreach name="enves" item="vo">
				<tr>
					<td class="enveid">{$vo.id}</td>
					<td>{$vo.user_name}</td>
					<td>{$vo.quest}</td>
					<td>{$vo.amount}</td>
					<td>{$vo.pay_type}</td>
					<td>
						<if condition="$vo.pay_status != 'ok'" ><font style="color:red">{$vo.pay_status}</font>
						<elseif condition="$vo.pay_status =='' "><font style="color:#45a1de">未支付</font><else/>ok</if>
					</td>
					<td>{$vo.openid}</td>
					<td>{$vo.add_time}</td>
					<td>

						<button class="remove-from-enve btn btn-sm btn-default btn-danger">删除</button>
					</td>
				</tr>
				</foreach>
			</tbody>
		</table>
		<div class="pagination">{$page}</div>
	</div>
	<script src="__PUBLIC__/js/common.js"></script>
	<script>
		$('.img-show').on('click',function(){
		   var img_src = $(this).attr('attr-img');
		   console.log(img_src);
            //页面层-自定义
            layer.open({
                type: 1,
                title: false,
                closeBtn: 0,
                shadeClose: true,
                skin: 'yourclass',
                content: '<img src="'+img_src+'"/>'
            });
		})

		$('.remove-from-enve').on('click', function() {
		    var enveid = $(this).parents('tr').find('.enveid').text();
			$.post("{:U('Enve/removeEnve')}", {'id':enveid}, function ($data) {
				alert($data.msg);
			});
		})
	</script>
</body>
</html>
